package com.ruoyi.project.info.history.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.info.history.mapper.PayHistoryMapper;
import com.ruoyi.project.info.history.domain.PayHistory;
import com.ruoyi.project.info.history.service.IPayHistoryService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 返佣明细Service业务层处理
 * 
 * @author wzm
 * @date 2022-09-07
 */
@Service
public class PayHistoryServiceImpl implements IPayHistoryService 
{
    @Autowired
    private PayHistoryMapper payHistoryMapper;

    /**
     * 查询返佣明细
     * 
     * @param id 返佣明细主键
     * @return 返佣明细
     */
    @Override
    public PayHistory selectPayHistoryById(Long id)
    {
        return payHistoryMapper.selectPayHistoryById(id);
    }

    /**
     * 查询返佣明细列表
     * 
     * @param payHistory 返佣明细
     * @return 返佣明细
     */
    @Override
    public List<PayHistory> selectPayHistoryList(PayHistory payHistory)
    {
        return payHistoryMapper.selectPayHistoryList(payHistory);
    }

    /**
     * 新增返佣明细
     * 
     * @param payHistory 返佣明细
     * @return 结果
     */
    @Override
    public int insertPayHistory(PayHistory payHistory)
    {
        payHistory.setCreateTime(DateUtils.getNowDate());
        return payHistoryMapper.insertPayHistory(payHistory);
    }

    /**
     * 修改返佣明细
     * 
     * @param payHistory 返佣明细
     * @return 结果
     */
    @Override
    public int updatePayHistory(PayHistory payHistory)
    {
        payHistory.setUpdateTime(DateUtils.getNowDate());
        return payHistoryMapper.updatePayHistory(payHistory);
    }

    /**
     * 批量删除返佣明细
     * 
     * @param ids 需要删除的返佣明细主键
     * @return 结果
     */
    @Override
    public int deletePayHistoryByIds(String ids)
    {
        return payHistoryMapper.deletePayHistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除返佣明细信息
     * 
     * @param id 返佣明细主键
     * @return 结果
     */
    @Override
    public int deletePayHistoryById(Long id)
    {
        return payHistoryMapper.deletePayHistoryById(id);
    }
}
